﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    
	  xmlns:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
    xmlns:editing="clr-namespace:ICSharpCode.AvalonEdit.Editing;assembly=ICSharpCode.AvalonEdit"
    
    xmlns:pinlvw="clr-namespace:SimpleControls.MRU.View;assembly=SimpleControls"
    xmlns:hyperl="clr-namespace:SimpleControls.Hyperlink;assembly=SimpleControls"
    >
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Themes;component/IconsLight.xaml" />
    <ResourceDictionary Source="/Themes;component/Generic/Brushes.xaml" />

    <!-- MsgBox brush definitions -->
    <ResourceDictionary Source="/MsgBox;component/Themes/LightBrushes.xaml" />
    <ResourceDictionary Source="/MsgBox;component/Themes/LightIcons.xaml" />

    <ResourceDictionary Source="/MiniUML.View;component/SharedResources.xaml"/>

    <!-- ResourceDictionary Source="/AvalonDock.Themes.Aero;component/Theme.xaml" / -->
  </ResourceDictionary.MergedDictionaries>

  <!--     xmlns:cmd="clr-namespace:Util.Command;assembly=Util"
  <Style x:Key="FileHyperlinkDefault"
         TargetType="{x:Type hyperl:FileHyperlink}"
         BasedOn="{StaticResource {x:Type hyperl:FileHyperlink}}" />

  <Style TargetType="{x:Type hyperl:FileHyperlink}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="ContextMenu">
      <Setter.Value>
        <ContextMenu>
          <MenuItem Header="Copy Url to Clipboard"
                    Command="{x:Static hyperl:FileHyperlink.CopyUri}"
                    CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
                    Margin="3" />

          <MenuItem DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
                    Command="cmd:AppCommand.LoadFile"                            
                    CommandParameter="{Binding NavigateUri}"
                    Margin="3" />

          <MenuItem Header="Open with Windows Application..."
                            Command="{x:Static hyperl:FileHyperlink.NavigateToUri}"
                            CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
                            Margin="3" />

          <MenuItem Header="Open containing folder"
                            Command="{x:Static hyperl:FileHyperlink.OpenContainingFolder}"
                            CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
                            Margin="3" />
          <Separator />

          <MenuItem Header="Remove"
                            Command="cmd:AppCommand.RemoveMruEntry"
                            CommandParameter="{Binding}"
                            CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
                            Margin="3" />

        </ContextMenu>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type hyperl:FileHyperlink}">
          <TextBlock ToolTip="{Binding ElementName=PART_Hyperlink, Path=NavigateUri}">
            <TextBlock.InputBindings>
              <KeyBinding Key="C" Modifiers="Ctrl" Command="{x:Static hyperl:FileHyperlink.CopyUri}"
                                                   CommandParameter="{Binding ElementName=PART_Hyperlink, Path=NavigateUri}"/>
            </TextBlock.InputBindings>
            <Hyperlink Name="PART_Hyperlink"
                       NavigateUri="{Binding Path=NavigateUri, RelativeSource={RelativeSource FindAncestor, AncestorType=hyperl:FileHyperlink, AncestorLevel=1}}"
                       Command="cmd:AppCommand.LoadFile"
                       CommandParameter="{Binding Path=NavigateUri, RelativeSource={RelativeSource FindAncestor, AncestorType=hyperl:FileHyperlink, AncestorLevel=1}}"
                       >
              <Hyperlink.Style>
                <!- Change resource to show underline on mouseover only ->
                <Style TargetType="{x:Type Hyperlink}">
                  <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="true">
                      <Setter Property="TextDecorations" Value="Underline" />
                      <Setter Property="Foreground" Value="{StaticResource HyperlinkForeground}" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                      <Setter Property="Foreground" Value="{StaticResource HyperlinkForegroundDisabled}" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="true">
                      <Setter Property="Cursor" Value="Hand" />
                    </Trigger>
                  </Style.Triggers>
                  <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
                  <Setter Property="Foreground" Value="{StaticResource HyperlinkForeground}" />
                </Style>
              </Hyperlink.Style>
                        <!- Moved link to event handler RequestNavigate="Hyperlink_RequestNavigate" to code behind ->
              <TextBlock Text="{Binding Path=Text, RelativeSource={RelativeSource FindAncestor, AncestorType=hyperl:FileHyperlink, AncestorLevel=1}}" />
            </Hyperlink>
          </TextBlock>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
-->

  <!-- Style x:Key="{x:Type StatusBarItem}" BasedOn="{StaticResource {x:Type StatusBarItem}}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Foreground" Value="Black" />
  </Style -->

  <Style TargetType="{x:Type pinlvw:PinableListViewItem}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="Padding" Value="1" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <!-- This is required for the PathTrimmingTextBlock -->
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListViewItem">
          <Border Name="ListemBackgroundBorder"
                  Padding="3"
                  BorderBrush="Transparent"
                  BorderThickness="1"
                  CornerRadius="3"
                  SnapsToDevicePixels="true"
                  Background="Transparent">
            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <!-- ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="ListemBackgroundBorder" Property="Background" Value="{StaticResource ListViewItemMouseOverGradient}"/>
              <Setter TargetName="ListemBackgroundBorder" Property="BorderBrush" Value="{StaticResource ListViewItemMouseOverBorder}" />
              <Setter TargetName="ListemBackgroundBorder" Property="BorderThickness" Value="1" />
            </Trigger>
            <!- Trigger Property="IsSelected" Value="true">
              <Setter TargetName="Border" Property="Background" Value="Black"/>
            </Trigger ->
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource PinableListViewForegroundDisabled}"/>
            </Trigger>
          </ControlTemplate.Triggers -->
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type pinlvw:PinableListView}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type pinlvw:PinableListView}">
          <Border Padding="0"
                  BorderThickness="0"
                  BorderBrush="Transparent"
                  
                  Name="Bd"
                  SnapsToDevicePixels="True"><!-- Background="{StaticResource ToolViewBackground}" -->
            <ScrollViewer Padding="0" Focusable="False">
              <ItemsPresenter SnapsToDevicePixels="True" />
            </ScrollViewer>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>